#include <stdio.h>
#include "movingAvg.h"


int main(int argc, char *argv[])
{
  // a sample array of numbers. The represent "readings" from a sensor over time
  int sample[] = {50, 10, 20, 18, 20, 100, 18, 10, 13, 500, 50, 40, 10};
  // the size of this array represents how many numbers will be used
  // to calculate the average
  double newAvg = 0;
  int count = sizeof(sample) / sizeof(int);
  for(int i = 0; i < count; i++){
    newAvg = movingAvg(sample[i]);
    printf("The new average is %f\n", newAvg);
  }
  char x= getchar();
  return 0;
}